﻿/********************************************************************************/
// <copyright file="NewsCategoryFactory.cs" company="Asia E-Business Solutions">
//     Copyright © 2012. All right reserved
// </copyright>
// <history>
//     <change who="Phuoc Le" date="24/12/2012 3:01:45 PM">Created</change>
// </history>
/********************************************************************************/

using System;
using System.Collections.Generic;
using LINQ = JLL.China.Infrastructure.Repositories.LINQ2SQL;

namespace JLL.China.Infrastructure.Repositories.News
{
    public static class NewsCategoryFactory
    {
        public static Model.NewsCategory FromLINQObject(LINQ.NewsCategory category)
        {
            if (category == null)
            {
                return null;
            }
            else
            {
                var model = new Model.NewsCategory
                {
                    ID = (int)category.NewsCate_ID,
                    CategoryName = category.CategoryName,
                    CategorySlug = category.CategorySlug,
                    Description = category.Description
                };
                return model;
            }
        }
    }
}
